package com.etc;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @Auther: zhezhe
 * @Date: 2018/10/1911:58
 * @Description:
 *
 *
 */
public class MapTest extends Mapper<LongWritable, Text,Text, IntWritable> {
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String lin = value.toString();
        String[] lins = lin.split(" ");
        for (String s : lins) {
            context.write(new Text(s),new IntWritable(1));

        }

    }
}
